<template>
	<view style="">
		<image src="/static/xgbj.png" class="qjimg" mode=""></image>
		<view class="title">
			<image @click="fanhui" src="/static/zfh.png" :style="'margin-top:'+top+'px;'" mode=""></image>
			<view class="toptit" :style="'margin-top:'+top+'px;'">
				访客通行
			</view>
			<view class="" style="opacity: 0;">12</view>
		</view>
		<view class="xgzl" @click="sift">
			筛选
			<image src="../../static/sjxh.png" mode=""></image>
		</view>
		<view class="tab">
			<view :class="stater==1?'tab2':'tab1'" @click="tab(1)">
				未通行
			</view>
			<view :class="stater==2?'tab2':'tab1'" @click="tab(2)">
				已通行/失效
			</view>
		</view>
		<view class="center">
			<view class="box" v-for="(item,index) in list" :key="index">
				<view class="box1">
					<view class="box1text">
						到访时间：{{item.visitorEffectiveTime}}
					</view>
					<view class="box1text1">

					</view>
				</view>
				<view class="box2">
					<view class="box2-1" style="margin-left: 30rpx;">
						<view class="" style="display: flex;justify-content: space-between;align-items: center;">
							<view class="box2-1text">
								{{item.room.address}}
								<view class="box2-1text1">
									{{item.room.personName}}
								</view>
							</view>
							<image style="width: 36rpx;height: 36rpx;" src="../../static/ydh.png" mode="">
							</image>
						</view>
						<view class="box2-1-1">
							<view class="box2-1-1box">
								访客姓名：
							</view>
							<view class="box2-1-1box1">
								<view class="box2-1-1box1_text">
									{{item.visitorName}}
								</view>
							</view>
						</view>
						<view class="box2-1-1">
							<view class="box2-1-1box">
								访客性别：
							</view>
							<view class="box2-1-1box1">
								<view class="box2-1-1box1_text">
									{{item.gender==1?'男':'女'}}
								</view>
							</view>
						</view>
						<view class="box2-1-1">
							<view class="box2-1-1box">
								访客电话：
							</view>
							<view class="box2-1-1box1">
								<view class="box2-1-1box1_text">
									{{item.hidephone}}
								</view>
								<image src="../../static/ydh.png" mode=""></image>
							</view>
						</view>
						<view class="box2-1-1">
							<view class="box2-1-1box">
								访问事由：
							</view>
							<view class="box2-1-1box1">
								<view class="box2-1-1box1_text">
									{{item.memo}}
								</view>
							</view>
						</view>
						<view class="box2-1-1">
							<view class="box2-1-1box">
								车辆信息：
							</view>
							<view class="box2-1-1box1">
								<view class="box2-1-1box1_text">
									鲁C 12345
								</view>
							</view>
						</view>
					</view>
					<view class="box3">
						<view class="">
							到达时间：
						</view>
						<view class="">
							{{item.visitorEffectiveTime}}
						</view>
					</view>
				</view>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				top: 0,
				stater: 1,
				roomId: '',
				datetime: '',
				keyword: '',
				memo: '',
				list: [],
				nextp: 1,
			}
		},
		onLoad() {
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
			// this.CustomBar = menuButtonInfo.bottom * 1 + 10
			this.top = menuButtonInfo.top * 1 + 10
		},
		onShow() {
			this.nextp = 1
			this.getlist()
		},
		onReachBottom() {
			this.getlist()
		},
		methods: {
			tab(e) {
				this.stater = e
				this.nextp = 1
				this.getlist()
			},
			sift() {
				uni.navigateTo({
					url: '/pages/fangkepass/fangkeSift'
				})
			},
			getlist() {
				if (this.nextp) {
					this.$post('wuyecenter/fangke', {
							type: this.stater,
							roomId: this.roomId,
							datetime: this.datetime,
							keyword: this.keyword,
							memo: this.memo,
						},
						res => {
							if (this.nextp == 1) {
								this.list = res.data.list
							} else {
								res.data.list.forEach(item => {
									this.list.push(item)
								})
							}
							this.nextp = res.data.nextp
						})
				}
			},
			fanhui() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: rgb(250, 250, 250);
	}

	.qjimg {
		width: 750rpx;
		height: 729rpx;
		position: absolute;
		top: 0;
		z-index: -1;
	}

	.title {
		display: flex;
		justify-content: space-between;
		align-items: center;

		>image {
			width: 20rpx;
			height: 35rpx;
			margin-left: 30rpx;
		}
	}

	.toptit {
		text-align: center;
		font-size: 36rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #ffffff;
	}

	.center {
		margin-top: 70rpx;
	}

	.xgzl {
		width: 162rpx;
		height: 60rpx;
		position: absolute;
		right: 20rpx;
		margin-top: 30rpx;
		border-radius: 30rpx;
		background-color: white;
		font-size: 26rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		text-align: center;
		line-height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;

		>image {
			width: 16rpx;
			height: 9rpx;
			margin-left: 10rpx;
		}
	}

	.tab {
		margin-top: 160rpx;
		display: flex;
		justify-content: space-evenly;
	}

	.tab2 {
		font-size: 30rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 30rpx;
		padding-bottom: 10rpx;
		border-bottom: 2px solid #d5e5ff;
	}

	.tab1 {
		font-size: 30rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 30rpx;
	}

	.box {
		margin-bottom: 20rpx;
	}

	.box1 {
		width: 685rpx;
		height: 63rpx;
		margin: 0 auto;

		background-image: linear-gradient(to right, #d5e5ff, #ffffff);
		border-top-left-radius: 15rpx;
		border-top-right-radius: 15rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.box1text {
		margin-left: 30rpx;
		font-size: 20rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #333333;
		line-height: 20rpx;
	}

	.box1text1 {
		margin-right: 30rpx;
		font-size: 20rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #333333;
		line-height: 20rpx;
	}

	.box2 {
		width: 685rpx;
		margin: 0 auto;
		background-color: white;
		border-bottom-left-radius: 15rpx;
		border-bottom-right-radius: 15rpx;
	}

	.box2-1 {
		width: 625rpx;
		margin: 0 30rpx;
		padding: 30rpx 0;
		border-bottom: 2px solid #e3e3e3;
	}

	.box2-1text {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #000000;
		line-height: 20rpx;
		display: flex;
		align-items: center;
	}

	.box2-1text1 {
		margin-left: 16rpx;
		width: 92rpx;
		height: 36rpx;
		background-color: #fff3d5;
		border-radius: 5%;
		font-size: 18rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #DE6D00;
		border-top-right-radius: 15rpx;
		border-bottom-right-radius: 15rpx;
		text-align: center;
		line-height: 36rpx;
	}

	.box2-1-1 {
		margin-top: 20rpx;
		display: flex;
		align-items: center;
	}

	.box2-1-1box {
		font-size: 24rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #999999;
		line-height: 24rpx;

		>view {
			font-size: 24rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #999999;
			line-height: 24rpx;
		}

	}

	.box2-1-1box1 {
		margin-left: 20rpx;
		display: flex;
		align-content: center;

		>image {
			margin-left: 40rpx;
			width: 26rpx;
			height: 26rpx;
		}
	}

	.box2-1-1box1_text {
		font-size: 24rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #333333;
		line-height: 24rpx;
		display: flex;
		align-items: center;

		>image {
			margin-left: 18rpx;
			width: 32rpx;
			height: 32rpx;
		}
	}

	.box2-1-1box1_text1 {
		font-size: 24rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #999999;
		line-height: 24rpx;
	}

	.box3 {
		width: 625rpx;
		display: flex;
		justify-content: space-between;
		margin: 0 auto;
		padding: 20rpx 0;

		>view {
			font-size: 24rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #333333;
			line-height: 20rpx;
		}
	}
</style>
